<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:p="http://primefaces.prime.com.tr/ui">
	<ui:composition template="/templates/padraoJSF.xhtml">
		<ui:define name="barraTitulo">Cadastro de Usu&aacute;rio</ui:define>
		<ui:define name="conteudo">
			<h:form id="form">
				<p:dialog header="Mensagem" id="dialog1" widgetVar="dialog" fixedCenter="true" modal="true" visible="#{facesContext.maximumSeverity != null}">
				   <p:messages/>                     
				</p:dialog>
				<p:tabView id="divTabView">
					<p:tab title="Cadastro">
						<h:panelGrid columns="3" columnClasses="width150 alinhaDir, width500">
							<h:outputText value=""/>
							<h:outputText value="Os campos com asterisco (*) s&atilde;o de preenchimento obrigat&oacute;rio." styleClass="campoObrigatorio" />
							<h:outputText value=""/>							
							<h:outputText value="Nome:" styleClass=""/>							
							<h:inputText  value="#{controleUsuario.usuario.nome}" requiredMessage="Campo [NOME] obrigat&oacute;rio" size="100"/>
							<h:outputText value="(*)" styleClass="campoObrigatorio" />
							<h:outputText value="Email:" styleClass=""/>							
							<h:inputText  value="#{controleUsuario.usuario.email}" requiredMessage="Campo [DESCRICAO] obrigat&oacute;rio" size="100"/>
							<h:outputText value="(*)" styleClass="campoObrigatorio" />
							<h:outputText value="Login:" styleClass=""/>							
							<h:inputText  value="#{controleUsuario.usuario.login}" requiredMessage="Campo [LOGIN] obrigat&oacute;rio" size="100"/>
							<h:outputText value="(*)" styleClass="campoObrigatorio" />
							<h:outputText value="Senha:" styleClass=""/>	
							
							<p:password minLength="6" value="#{controleUsuario.usuario.senha}" styleClass="textfield" size="30"
								promptLabel="Digite uma senha segura" 
								goodLabel="Boa" 
								weakLabel="Razo&aacute;vel" 
								trongLabel="Excelente"
								strongLabel="Forte" />  
															
							<h:outputText value="(*)" styleClass="campoObrigatorio" />							
							<h:outputText value="Grupo:" styleClass=""/>							
							<h:selectOneMenu value="#{controleUsuario.usuario.grupo}" id="listaGrupo">
			                    <f:converter converterId="converteGrupo" />
			                    <f:selectItems value="#{controleUsuario.listaGrupo}" var="grupo" itemLabel="#{grupo.descricao}" itemValue="#{grupo}"/>
							</h:selectOneMenu>
														
						</h:panelGrid>
					</p:tab>
				</p:tabView>				
				<h:commandLink action="#{controleUsuario.gravar}" styleClass="alinhaDir">
					<h:graphicImage url="/images/botoes/btnGravar.png" class="btnAcoes"/>
				</h:commandLink>				
				<h:commandLink action="#{controleUsuario.limpar}">
					<h:graphicImage url="/images/botoes/btnLimpar.png" class="btnAcoes"/>
					<f:ajax render="divTabView"/>
				</h:commandLink>	
				<h:outputLink value="manutencao.jsf">
					<h:graphicImage url="/images/botoes/btnPesquisar.png" class="btnAcoes"/>
				</h:outputLink>	
				
			</h:form>
		</ui:define>
	</ui:composition>
</html>